<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ice="http://www.icesoft.com/icefaces/component"
      xmlns:c="http://java.sun.com/jstl/core">
    <body>
        <ui:composition template="../../../templates/template.xhtml">

            <ui:define name="title">/Aurea/Area-Privada/Cuentas</ui:define>

            <ui:define name="mainContent">


                <ice:form id="accountingForm">

                <SCRIPT>
                function setDescription(concept, text){
                    var element = document.getElementById('accountingForm:descripcion');
                    element.childNodes[0].nodeValue=concept+': '+text;
                }
                </SCRIPT>

                    <div>
                        Tituloooooo
                    </div>

                    <ice:dataTable id="accountingTable" var="item" value="#{accountingCtrl.data.accounts}">

                        <f:facet name="header">
                            Título de la tabla.ss
                        </f:facet>

                        <ice:column styleClass="tblSelect">
                            <f:facet name="header"><h:outputLabel value="ho" style="display:none"/></f:facet>
                                <ice:commandLink actionListener="#{accountingCtrl.commandLinkListener}" partialSubmit="true" rendered="#{item.isFather}">
                                    <f:param name="selectedId" value="#{item.id}"  />
                                    <img src="../../../images/bullet_arrow.png" width="5" height="5" alt="seleccionar"/>
                                </ice:commandLink>
                        </ice:column>

                        <ice:column>
                            <f:facet name="header">(i18)Concepto</f:facet>
                            <ice:commandLink value="#{item.name}" styleClass="#{item.style}" actionListener="#{accountingCtrl.commandLinkListener}"
                                             partialSubmit="true" rendered="#{item.isFather}"  onmouseover="setDescription('#{item.name}','#{item.description}');">
                                    <f:param name="selectedId" value="#{item.id}"  />
                            </ice:commandLink>
                            <ice:outputLabel value="#{item.name}" styleClass="#{item.style}" rendered="#{!item.isFather}"  onmouseover="setDescription('#{item.name}','#{item.description}');"/>
                        </ice:column>

                        <ice:column>
                            <f:facet name="header">(i18)Fecha</f:facet>
                            <ice:outputLabel value="#{item.date}" styleClass="#{item.style}"   onmouseover="setDescription('#{item.name}','#{item.description}');">
                                <f:convertDateTime pattern="dd/MM/yyyy hh:mm" />
                            </ice:outputLabel>
                        </ice:column>

                        <ice:column>
                            <f:facet name="header">(i18)Importe</f:facet>
                            <ice:commandLink  value="#{item.value}" styleClass="#{item.style}" actionListener="#{accountingCtrl.commandLinkListener}"
                                              partialSubmit="true" rendered="#{item.isFather}"  onmouseover="setDescription('#{item.name}','#{item.description}');">
                                    <f:param name="selectedId" value="#{item.id}"  />
                            </ice:commandLink>
                            <ice:outputLabel value="#{item.value}" styleClass="#{item.style}" rendered="#{!item.isFather}"  onmouseover="setDescription('#{item.name}','#{item.description}');"/>
                        </ice:column>

                        <ice:column styleClass="tblSelect">
                            <f:facet name="header"><h:outputLabel value="0" style="display:none"/></f:facet>
                                <ice:commandLink actionListener="#{accountingCtrl.toggleModal}" partialSubmit="true" rendered="#{item.isFather}">
                                    <img src="../../../images/plus-frame.png" width="11" height="11" alt="seleccionar" title="Añadir"/>
                                </ice:commandLink>
                        </ice:column>

                        <f:facet name="footer">
                            
                        </f:facet>

                    </ice:dataTable>

                    <div class="linea">
                        <ice:outputLabel id="descripcion" value="Descripción"/>
                    </div>


<!-- ooooooooooooooooooooooooooooooo -->

<ice:panelPopup id="modalPnlPop"
                draggable="false" modal="true"
                visible="#{accountingCtrl.data.modalRendered}"
                autoCentre="true"
                styleClass="corePopup">
    <f:facet name="header">
        <ice:panelGroup styleClass="popupHeaderWrapper">
            <ice:outputText value="Añadir nuevo registro" />
            <ice:commandLink actionListener="#{accountingCtrl.toggleModal}" partialSubmit="true">
                    <img src="../../../images/cerrar-frame.png" width="11" height="11" alt="seleccionar" title="(i18)Cerrar"/>
                </ice:commandLink>
        </ice:panelGroup>
    </f:facet>
    <f:facet name="body">
        <ice:panelGroup styleClass="popupBody">
            <ice:outputText value="hola mundo"/><br/>
            </ice:panelGroup>
    </f:facet>
</ice:panelPopup>












                </ice:form>

            </ui:define>

        </ui:composition>
    </body>
</html>

